1. Field of the Invention
The present invention relates to an image processing apparatus, an image recording apparatus and an image processing method, and more particularly, it relates to an image processing apparatus, an image recording apparatus and an image processing method each of which adaptively applies gradation conversion processing to an image.
2. Description of the Related Art
The gradation of an image is one of the important factors that determine the quality of the image. In general, the signal output from an image pickup device is substantially in proportion to the quantity of light entering in the image pickup device. In a subsequent image process, the output signal from the image pickup device is subjected to some gradation conversion process in accordance with the final image observation environment (e.g., image observation on a monitor, image observation on a printout, or the like). For example, in the case of a general digital camera, the sRGB color space is adopted as the standard color space of the image file format, and the gradation of an image picked up by the digital camera is designed so that the optimum gradation can be obtained when the image is displayed on a monitor having a gamma characteristic according to the sRGB provision (γ=2.2).
Usually, the gradation conversion characteristic of an image is generally fixed to one kind for each input device such as a digital camera, or selected by a user or the like among a plurality of gradation conversion characteristics. Further, in recent years, techniques have been tried to be used for adaptively optimizing the gradation conversion characteristic for each image in accordance with the brightness distribution in the image (or the scene). This is because the dynamic range of subject field varies from scene to scene. If the gradation of an image is converted by a uniform gradation conversion characteristic without considering the variation of the dynamic range, it is difficult for the brightness information of the subject field to be efficiently reflected on the dynamic range of an output device such as a monitor or a printer.
As one of the techniques for adaptively optimizing the gradation conversion characteristic for each image, a histogram equalization method is known. This is a technique in which the quantity of brightness information of an image is increased by applying a gradation conversion such that the brightness histogram of the image (the frequency values of brightness gradation levels) is made even, and thereby the gradation is efficiently allotted to the output device.
However, if such a gradation conversion is uniformly applied irrespective of the image pickup conditions and the scene, there may be a case where the gradation is converted undesirably for a certain image (scene), for example, the noise of a dark portion is amplified to exceed its permissible level.
As an example of a measure to solve the above problem, in a technique proposed in JP-A-2003-179809, the brightness distribution of an image is detected. From the detected brightness distribution, it is judged whether or not the brightness distribution needs correction. When the brightness distribution is judged to need correction, the brightness distribution is corrected so as to be made even, and thereby the degradation of the output image is prevented.